﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NetStatistics
{
	[Serializable]
	public class TcpConnectionInfo
	{
		private string localAddress;
		public string LocalAddress
		{
			get { return localAddress; }
			set { localAddress = value; }
		}

		private int localPort;
		public int LocalPort
		{
			get { return localPort; }
			set { localPort = value; }
		}

		private int remotePort;
		public int RemotePort
		{
			get { return remotePort; }
			set { remotePort = value; }
		}


		private string remoteAddress;
		public string RemoteAddress
		{
			get { return remoteAddress; }
			set { remoteAddress = value; }
		}

		private string state;
		public string State
		{
			get { return state; }
			set { state = value; }
		}

		public override bool Equals(object obj)
		{
			TcpConnectionInfo info = obj as TcpConnectionInfo;

			if (info == null)
				return false;

			return (info.LocalAddress == this.LocalAddress
				&& info.RemoteAddress == this.RemoteAddress
				&& info.LocalPort == this.LocalPort
				&& info.RemotePort == this.RemotePort);
		}
	}
}
